package org.west.sky.frame.activiti.study;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * author: chz
 * date: 2025/10/8
 * description:
 */
@Controller
public class TE {

    @RequestMapping("/te")
    public String te() {
        return "index.html";
    }

    @ResponseBody
    @RequestMapping(value = "/gateway/portal/common/user/getUserInfoByToken", method = RequestMethod.GET)
    public Map<String, Object> userinfo(HttpServletRequest request) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", 0);
        map.put("msg", "操作成功");
        Map<String, Object> data = new HashMap<>();
        data.put("accessToken", request.getHeader("Authorization"));
        data.put("userId", 2);
        data.put("realName", "测试同步数据1");
        data.put("username", "测syncData2");
        data.put("phone", "phone123");
        data.put("workCode", "5");
        data.put("deptInfos", new HashMap<>());
        map.put("data", data);
        return map;
    }
}
